<?php
interface Model_NewsService {
     
    /**
     * Set news as important 
     * 
     * @param Model_Entity_News $news
     * @return void
     */
    public function setIsImportant(Model_Entity_News $news);
    
    /**
     * Set news unread 
     * 
     * @param Model_Entity_News $news
     * @return void
     */
    public function setIsRead(Model_Entity_News $news);
    
    /**
     * Get all news for a given feed
     * 
     * @param $feed
     * @return array of Model_Entity_News
     */
    public function getNews(Model_Entity_Feed $feed);
    
    /**
     * Get unread user news count
     * 
     * @param int $feedID
     * @param int $userID
     * @return int
     */
    public function getUnreadNewsCount($feedID, $userID);
    
    /**
     * Get all user news for a given feed
     * 
     * @param Model_Entity_Feed $feed
     * @return array of Model_Entity_News
     */
    public function getUserNews(Model_Entity_Feed $feed);
    
    /**
     * Add a news
     * 
     * @param Model_Entity_News $news
     * @return int the id of the inserted news
     */
    public function addNews(Model_Entity_News $news);
    
    /**
     * Add a user news
     * 
     * @param Model_Entity_News $news
     * @return void
     */
    public function addUserNews(Model_Entity_News $news);
    
    /**
     * Fetch all news marked as important by a user
     * 
     * @param int $userID
     * @return array of Model_Entity_News
     */
    public function getImportantNews($userID);
    
    /**
     * Mark as deleted a given user news
     * 
     * @param Model_Entity_News $news
     * @return void
     */
    public function deleteUserNews(Model_Entity_News $news);
    
    /**
     * Search for news matching search criteria based on contents of 
     * title description and body 
     * 
     * @param array $criteria
     * @return array of Model_Entity_News
     */
    public function searchUserNews($criteria);
}